%
% This function aggregates a series of fuzzy sets in interval format.
% The single argument y should be a [N,2*m] matrix, where m is the number
% of fuzzy sets contained.  The storage format is [[l1.h1], [l2,h2], ... [lm,hm]]
% and all the intervals should have the same implicit alpha value or you get junk
%
function z = fuzzy_vector_add(y)

sz = size(y);

count = sz(2) / 2;

if(round(count) ~= count)
	error('Malformed data');
end

z = zeros([size(y)(1),2]);

for ii = 1:count
	z = z + y(:,2*ii-1:2*ii);
end
